package china.nanjing.mykingdom.common;

import org.springframework.cloud.stream.annotation.Input;
import org.springframework.cloud.stream.annotation.Output;
import org.springframework.cloud.stream.binder.PollableMessageSource;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.PollableChannel;

/**
 * @author Chen Hongyu
 */
// https://docs.spring.io/spring-cloud-stream/docs/current/reference/htmlsingle/#spring-cloud-streams-overview-using-polled-consumers
    // http://www.itmuch.com/spring-cloud/spring-cloud-stream-study/#PollableMessageSource
public interface PolledEnvoyMQ {

    String POLLED_ENVOY_IN = "polledEnvoyInput";
    String POLLED_ENVOY_OUT = "polledEnvoyOut";

    // 允许消费者控制消费速率
    @Input(value = POLLED_ENVOY_IN)
    PollableMessageSource destIn();

    @Output(value = POLLED_ENVOY_OUT)
    MessageChannel destOut();

}
